import { createRouter, createWebHashHistory } from 'vue-router'
import routes from './config.js'
const routerHistory = createWebHashHistory()
// createWebHashHistory hash 路由
// createWebHistory history 路由
// createMemoryHistory 带缓存 history 路由
const router = createRouter({
    history: routerHistory,
    routes: routes
})

router.beforeEach((to, from) => {
    console.log(to)
    document.title = to.meta.title;
    // ...
    // 返回 false 以取消导航
    // return false
})

export default router
